package com.xxxx.portal.util;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author nathan-wang on 2020-11-03
 */
@Component
public class SendMsgUtil {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String phone) {
//        String msg = "用户已注册成功，快快给他发送通知短信，谢谢!";
        //发送信息——交换机,路由key,消息
        rabbitTemplate.convertAndSend("topicExchange", "topic.msg", phone);
    }
}

